<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
include("ListResult.php");
$strSQL = $strSQL." order by ID desc limit ".(($intPageNow-1)*$intPageNo).",".$intPageNo." ";

if(!$RS = PMA_mysql_query($strSQL, $$_Conn)){
	$GLOBALS["errormessage"] = $_strMarquee["ErrMessage"];//"系統發生錯誤, 請連絡工程師！";
	$GLOBALS["errorhidden"] = "\n Error: ".PMA_mysql_error($$_Conn).",\nSQL: ".$strSQL.",\nLine: ".__LINE__.",\nPage: ".__FILE__;
	ErrMsgOutputHTML("Error", "", 1);
}

$fp = @file($strTemplatePath."List.html");
$fp = implode("", $fp);
$fp = setHTMLCharset($fp);

while(list($k, $v) = each($_strSelectGLine)){
	$fp = str_replace("{".$k."}", $v, $fp);
}

$strCon = "";
//分頁下拉清單
for($i = 1; $i <= $intTotalPage; $i++){
	if($i == $intPageNow){
		$strCon .= "<option value='".$i."' selected>".$i."</option>\n";
	}else{
		$strCon .= "<option value='".$i."'>".$i."</option>\n";
	}
}
$fp = str_replace("{PageSelectOpion}", $strCon, $fp);
$fp = str_replace("{intTotalPage}", $intTotalPage, $fp);
$fp = str_replace("{intPageNow}", $intPageNow, $fp);
$fp = str_replace("{intTotal}", $intTotal, $fp);

//內容清單
$intNo = 0;
$strCon = "";
$strTmp = "";
preg_match("/<!-- @ Content Start @ \/\/-->(.+)<!-- @ Content End @ \/\/-->/s", $fp, $arrCon);
while($Rows = PMA_mysql_fetch_object($RS)){
	$strTmp = $arrCon[1];
	
	$strTmp = str_replace("{ShowNo}", $intNo, $strTmp);
	$strTmp = str_replace("{ShowID}", $Rows -> ID, $strTmp);
	$strTmp = str_replace("{ShowLType}", $_arrLType[$Rows -> LType], $strTmp);
	$strTmp = str_replace("{ShowBetType}", $_arrBet_Type[$Rows -> LType][$Rows -> BetType], $strTmp);
	$strTmp = str_replace("{ShowApoint}", $_strSelectGLine["ApointNumTip"][$Rows -> LType][$Rows -> BetType][$Rows -> ApointNum], $strTmp);
	$strTmp = str_replace("{ShowALine}", $Rows -> ALine, $strTmp);
	$strTmp = str_replace("{ShowBLine}", $Rows -> BLine, $strTmp);
	$strTmp = str_replace("{ShowCLine}", $Rows -> CLine, $strTmp);
	$strCon .= $strTmp."\n";
	$intNo++;

}
$fp = str_replace("{ShowTNo}", $intNo, $fp);
$fp = preg_replace("/<!-- @ Content Start @ \/\/-->.+<!-- @ Content End @ \/\/-->/s", $strCon, $fp);

//輸出
WebOutputHTML($fp, 1);
?>